<?php
if(!isset(Yii::app()->user->id)|| (isset(Yii::app()->user->id)&&Yii::app()->user->id!=15))
{
    //$this->redirect(Yii::app()->request->baseUrl);
}
?>

<h2>Quản lý user</h2>

<table width="100%" border="1">
	<tr>
		<td align="center" bgcolor="#F1F1F1"><strong>id</strong></td>
		<td align="center" bgcolor="#F1F1F1"><strong>Your Name</strong></td>
		<td align="center" bgcolor="#F1F1F1"><strong>User Name</strong></td>
		<td align="center" bgcolor="#F1F1F1"><strong>LR account</strong></td>
		<td align="center" bgcolor="#F1F1F1"><strong>Money</strong></td>
		<td align="center" bgcolor="#F1F1F1"><strong>Email</strong></td>
		<td align="center" bgcolor="#F1F1F1"><strong>Date Reg</strong></td>
		<td align="center" bgcolor="#F1F1F1"><strong>Action</strong></td>
	</tr>
  <?php if(isset($users)):?>
	<?php foreach ($users as $u):?>
  <tr>
    <td><?php echo $u['user_id'];?></td>
    <td><?php if($u['active']==2 || $u['active']==0){echo '<s>';}
    	echo $u['user_name'];
    	if($u['active']==2 || $u['active']==0){echo '</s>';}
    	?></td>
    <td><?php echo $u['user_name'];?></td>
    <td><?php echo $u['lr_acc'];?></td>
    <td><?php echo $u['lr_money'];?></td>
    <td><?php echo $u['email'];?></td>
    <td><?php echo $u['date_reg'];?></td>
    <td>
    	<?php
			$url = Yii::app()->request->baseUrl . '/backend/admin/editusers/id/'. $u['user_id'];
			echo CHtml::link('<< Edit >>', $url);
		?>
	</td>
    <?php endforeach;?>
    <?php endif;?>
  </tr>
</table>
